#include "qmlgraphicsitem.h"

QmlGraphicsItem::QmlGraphicsItem(QQuickItem* parent) : QQuickItem(parent)
{
    setAcceptHoverEvents(true);
}

QmlGraphicsItem::~QmlGraphicsItem()
{
}

void QmlGraphicsItem::setView(QmlGraphicsView* item)
{
    if (nullptr == item)
    {
        return;
    }

    m_viewItem = item;
    emit viewChanged();
}

void QmlGraphicsItem::setSelected(bool selected)
{
    if (m_selected != selected)
    {
        m_selected = selected;
        emit selectedChanged();
    }
}

void QmlGraphicsItem::setBackground(QColor background)
{
    if (m_background != background)
    {
        m_background = background;
        emit backgroundChanged();
    }
}
